Forum Discussion
CI/CD dataflow issue
Hi GeekAlfPro,
THere's no reference to the variable library in that M code.
If you want it to pull the value from the variable library, you will need to reference the variable library like this:
Variable.ValueOrDefault("$(/**/My Library/My Variable)", "Sample")
Then, after you've done the git commit and git push, you still need to do a git pull in the workspace. You can do that by clicking the update all button in the source control menu of the workspace.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
i modified my code like this
[...]
in
#"Valeur remplacée";
shared #"moeny Numérique_DataDestination" = let
// 🔧 Lecture des variables de bibliothèque avec valeur par défaut
ws_Dirnum_id = Variable.ValueOrDefault("$(/**/My library/ws_Dirnum_id)", "00000000-0000-0000-0000-000000000000"),
wh_Dirnum_id = Variable.ValueOrDefault("$(/**/My library/wh_Dirnum_id)", "00000000-0000-0000-0000-000000000000"),
// 🧭 Navigation dynamique Fabric (Warehouse cible)
Pattern = Fabric.Warehouse([HierarchicalNavigation = null, CreateNavigationProperties = false]),
Navigation_1 = Pattern{[workspaceId = ws_Dirnum_id]}[Data],
Navigation_2 = Navigation_1{[warehouseId = wh_Dirnum_id]}[Data],
TableNavigation = Navigation_2{[Schema = "dbo", Item = "Fact_Budget_DN"]}[Data]
in
TableNavigation;i've done a pull but without success
- GeekAlfPro9 months agoHelper V
Hi,
i tried the library variables with a pipeline but it doesn't work either !
has anybody managed to set up library variables with a pipeline and dataflow Gen 2 ?
- tayloramy9 months agoSuper User
Hi GeekAlfPro,
inws_Dirnum_id = Variable.ValueOrDefault("$(/**/My library/ws_Dirnum_id)", "00000000-0000-0000-0000-000000000000"),you need to replace My library with the name of your variable library.
I just made a super simplistic test for variable libraries in my enviornment and they work without issue.
Here is my workspace:
in DEV, this is my variable library:
and this is the query in my dataflow:
this results in this record in the lakehouse:
So it properly pulled from the variable library.
Now when I deploy this to PROD with a deployment pipeline:
and I update the prod variable library:
I see the value of the prod variable library in the table in my prod lakehouse:
This is quite simplistic, but shows that variable librarys work without issue.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.- GeekAlfPro9 months agoHelper V
Hello tayloramy
Thanks for the time
i was wrong on the "My Library" i modified it and it works fine in the dev environment
i deployed it in my prod environment but i have this error msg now
Budget Direction Numérique_WriteToDataDestination : Un problème est survenu lors de l’actualisation du flux de données : « Data source credentials are missing or invalid. Please update the connection credentials in settings, and try again. ». Code d’erreur : 999999. (ID de requête : 17e56f91-9b52-482e-90b0-234f7eb53bc3).for my variables library i set it up like this
it's sligthly different from yours, but it should work, no ?
and my code is
[StagingDefinition = [Kind = "FastCopy"]] section Section1; [DataDestinations = {[Definition = [Kind = "Reference", QueryName = "Budget Direction Numérique_DataDestination", IsNewTarget = false], Settings = [Kind = "Manual", AllowCreation = false, ColumnSettings = [Mappings = {[SourceColumnName = "Année Budgétaire", DestinationColumnName = "Année Budgétaire"], [SourceColumnName = "Ligne Budgétaire", DestinationColumnName = "Ligne Budgétaire"], [SourceColumnName = "Commentaires", DestinationColumnName = "Commentaires"], [SourceColumnName = "Budget Initial", DestinationColumnName = "Budget Initial"], [SourceColumnName = "ID", DestinationColumnName = "ID"], [SourceColumnName = "Modifié", DestinationColumnName = "Modifié"], [SourceColumnName = "Budget_Quasi_ID", DestinationColumnName = "Budget_Quasi_ID"]}], DynamicSchema = false, UpdateMethod = [Kind = "Replace"], TypeSettings = [Kind = "Table"]]]}] shared #"Budget Direction Numérique" = let Source = SharePoint.Tables("https://url", [Implementation = "2.0", ViewMode = "All"]), #"Navigation 1" = Source{[Id = "d8705c22-bb55-482b-c55d-6bb0039314d4"]}[Items], #"Colonnes supprimées" = Table.RemoveColumns(#"Navigation 1", {"Title", "Balise de couleur", "ID de ressource de conformité", "Direction", "Modifié par", "Créé", "Type de contenu", "Créé par", "Version", "Pièces jointes", "Modifier", "Type", "Nombre d'éléments enfants", "Nombre d’enfants du dossier", "Paramètres de l’étiquette", "Étiquette de rétention", "Étiquette de rétention appliquée", "Étiquette appliquée par", "L’élément est un enregistrement", "Application créée par", "Application modifiée par"}), #"Colonne personnalisée ajoutée" = Table.AddColumn(#"Colonnes supprimées", "Budget_Quasi_ID", each [Année Budgétaire] & " - " & [Ligne Budgétaire]), #"Type de colonne changé" = Table.TransformColumnTypes(#"Colonne personnalisée ajoutée", {{"Budget_Quasi_ID", type text}, {"Budget Initial", type number}}), #"Valeur remplacée" = Table.ReplaceValue(#"Type de colonne changé", null, 0, Replacer.ReplaceValue, {"Budget Initial"}) in #"Valeur remplacée"; shared WorkspaceId = let Source = Variable.ValueOrDefault("$(/**/vl_variable_Dev_Prod/ws_Dirnum_id)") in Source; shared WarehouseId = let Source = Variable.ValueOrDefault("$(/**/vl_variable_Dev_Prod/wh_Dirnum_id)") in Source; shared #"Budget Direction Numérique_DataDestination" = let Pattern = Fabric.Warehouse([HierarchicalNavigation = null, CreateNavigationProperties = false]), Navigation_1 = Pattern{[workspaceId = ws_Dirnum_id]}[Data], Navigation_2 = Navigation_1{[warehouseId = wh_Dirnum_id]}[Data], TableNavigation = Navigation_2{[Schema = "dbo", Item = "Fact_Budget_DN"]}[Data] in TableNavigation;