You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Token Replacement: Using naming prefixes to support forking and instantiating the repo for CARML consumers #909
Currently a lot of the resources in the CARML repo use static names for resources (i.e. dependency pipeline resources and resources that must have unique name across Azure like Storage and key vault). We need to brainstorm how we can leverage the existing token replacement service to create name prefixes (i.e. using local tokens in the settings file or another method). And then implement it.
Updated all parameter files for the dependency pipeline to use the new namePrefix token for sxx. Encountered two issues within the dependency pipeline yaml:
Storage Account Upload
# Get storage account name$parameterFilePath=Join-Path'$(Build.SourcesDirectory)''$(dependencyPath)''$(resourceType)''parameters''parameters.json'$storageAccountParameters= (ConvertFrom-Json (Get-Content-path $parameterFilePath-Raw)).parameters
Key Vault Secrets
# Get key vault name$parameterFilePath=Join-Path'$(Build.SourcesDirectory)''$(dependencyPath)''$(resourceType)''parameters''parameters.json'$keyVaultParameters= (ConvertFrom-Json (Get-Content-Path $parameterFilePath-Raw)).parameters
$keyVaultName=$keyVaultParameters.name.value
They're using the parameter files for the source of the name. Which can't be used before tokens are replaced.
Hey Ahmad Abdalla (@ahmadabdalla), makes sense. I'm using the same method for retrieving the image template name in a new addition to the dependency pipeline. That would fail too.
The first thing I could think of is to leverage the token replacement in the failing PS job, right before retrieving the parameter values. Probably adding a PS task with something like this snippet would be enough
Erika Gressi (@eriqua) .. yep that's what I was going to with. Thanks for the image note as well :) There's also a static guid that I saw, here. Is that a generic GUID? Or specific? If specific maybe we can follow the same approach to msiPrincipalId?
Ahmad Abdalla (@ahmadabdalla) that's the object Id for the tenant Backup Management Service. It's tenant specific unfortunately so we cannot retrieve it automatically unless we add AAD rights to the SPN I guess. It's not generated by a module so we cannot leverage the output as done with the msiPrincipalId approach.
We could investigate on the alternative to use RBAC on the KV instead of Access policies though..
Erika Gressi (@eriqua) , we'll think through how to resolve for the backup management service. In the meantime, this issue will have a dependency on #929
Yes Ahmad Abdalla (@ahmadabdalla), for the topic at hand we can apply the same solution to the updated dependency pipeline as well. So if it works already for storage and keyvault it should be a quick addition
Activity
ahmadabdalla commentedon Jan 25, 2022
Updated all parameter files for the dependency pipeline to use the new
namePrefixtoken forsxx. Encountered two issues within the dependency pipeline yaml:Storage Account Upload
Key Vault Secrets
They're using the parameter files for the source of the name. Which can't be used before tokens are replaced.
Erika Gressi (@eriqua) .. lets sync up to discuss this soon.
eriqua commentedon Jan 26, 2022
Hey Ahmad Abdalla (@ahmadabdalla), makes sense. I'm using the same method for retrieving the image template name in a new addition to the dependency pipeline. That would fail too.
The first thing I could think of is to leverage the token replacement in the failing PS job, right before retrieving the parameter values. Probably adding a PS task with something like this snippet would be enough
What do you think?
ahmadabdalla commentedon Jan 26, 2022
Erika Gressi (@eriqua) .. yep that's what I was going to with. Thanks for the image note as well :) There's also a static guid that I saw, here. Is that a generic GUID? Or specific? If specific maybe we can follow the same approach to msiPrincipalId?
eriqua commentedon Jan 26, 2022
Ahmad Abdalla (@ahmadabdalla) that's the object Id for the tenant Backup Management Service. It's tenant specific unfortunately so we cannot retrieve it automatically unless we add AAD rights to the SPN I guess. It's not generated by a module so we cannot leverage the output as done with the msiPrincipalId approach.
We could investigate on the alternative to use RBAC on the KV instead of Access policies though..
ahmadabdalla commentedon Jan 27, 2022
Erika Gressi (@eriqua) , we'll think through how to resolve for the backup management service. In the meantime, this issue will have a dependency on #929
eriqua commentedon Jan 27, 2022
Yes Ahmad Abdalla (@ahmadabdalla), for the topic at hand we can apply the same solution to the updated dependency pipeline as well. So if it works already for storage and keyvault it should be a quick addition
ahmadabdalla commentedon Jan 27, 2022
New Issue created for Backup Identity - Object ID #937 so that we don't solve for different problems in one issue. Thanks Erika Gressi (@eriqua)