Skip to content

Commit

Permalink
change env variable setting
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Dec 20, 2023
1 parent 7811d1e commit 6977f29
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/Build-Test-And-Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,14 @@ jobs:
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
az containerapp up -n $CONTAINER_APP_NAME -g $RESOURCEGROUP --image $CONTAINER_REGISTRY/essentialcsharpweb:${{ github.sha }} --environment $CONTAINER_APP_ENVIRONMENT --registry-server $CONTAINER_REGISTRY --ingress external --registry-username $ACR_USERNAME --registry-password $ACR_PASSWORD
az containerapp secret set -n $CONTAINER_APP_NAME -g $RESOURCEGROUP --secrets github-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientid,identityref:$MANAGEDIDENTITYID github-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientsecret,identityref:$MANAGEDIDENTITYID msft-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientid,identityref:$MANAGEDIDENTITYID msft-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientsecret,identityref:$MANAGEDIDENTITYID emailsender-apikey=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-apikey,identityref:$MANAGEDIDENTITYID emailsender-secret=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-secretkey,identityref:$MANAGEDIDENTITYID emailsender-name=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-sendfromname,identityref:$MANAGEDIDENTITYID emailsender-email=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-sendfromemail,identityref:$MANAGEDIDENTITYID connectionstring=keyvaultref:$KEYVAULTURI/secrets/connectionstrings-essentialcsharpwebcontextconnection,identityref:$MANAGEDIDENTITYID
az containerapp update --name $CONTAINER_APP_NAME --resource-group $RESOURCEGROUP --replace-env-vars Authentication:github:clientId=secretref:github-clientid Authentication:github:clientSecret=secretref:github-clientsecret Authentication:microsoft:clientId=secretref:msft-clientid Authentication:microsoft:clientSecret=secretref:msft-clientsecret AuthMessageSender:ApiKey=secretref:emailsender-apikey AuthMessageSender:SecretKey=secretref:emailsender-secret AuthMessageSender:SendFromName=secretref:emailsender-name AuthMessageSender:SendFromEmail=secretref:emailsender-email ConnectionStrings:EssentialCSharpWebContextConnection=secretref:connectionstring
az containerapp secret set -n $CONTAINER_APP_NAME -g $RESOURCEGROUP --secrets github-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientid,identityref:$MANAGEDIDENTITYID \
github-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientsecret,identityref:$MANAGEDIDENTITYID msft-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientid,identityref:$MANAGEDIDENTITYID \
msft-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientsecret,identityref:$MANAGEDIDENTITYID emailsender-apikey=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-apikey,identityref:$MANAGEDIDENTITYID \
emailsender-secret=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-secretkey,identityref:$MANAGEDIDENTITYID emailsender-name=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-sendfromname,identityref:$MANAGEDIDENTITYID \
emailsender-email=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-sendfromemail,identityref:$MANAGEDIDENTITYID connectionstring=keyvaultref:$KEYVAULTURI/secrets/connectionstrings-essentialcsharpwebcontextconnection,identityref:$MANAGEDIDENTITYID
az containerapp update --name $CONTAINER_APP_NAME --resource-group $RESOURCEGROUP --replace-env-vars Authentication--github--clientId=secretref--github-clientid Authentication--github--clientSecret=secretref--github-clientsecret \
Authentication--microsoft--clientId=secretref--msft-clientid Authentication--microsoft--clientSecret=secretref--msft-clientsecret AuthMessageSender--ApiKey=secretref--emailsender-apikey AuthMessageSender--SecretKey=secretref--emailsender-secret \
AuthMessageSender--SendFromName=secretref--emailsender-name AuthMessageSender--SendFromEmail=secretref--emailsender-email ConnectionStrings--EssentialCSharpWebContextConnection=secretref--connectionstring
- name: Logout of Azure CLI
if: 'always()'
uses: azure/CLI@v1
Expand Down Expand Up @@ -197,8 +203,14 @@ jobs:
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
az containerapp up -n $CONTAINER_APP_NAME -g $RESOURCEGROUP --image $CONTAINER_REGISTRY/essentialcsharpweb:${{ github.sha }} --environment $CONTAINER_APP_ENVIRONMENT --registry-server $CONTAINER_REGISTRY --ingress external --registry-username $ACR_USERNAME --registry-password $ACR_PASSWORD
az containerapp secret set -n $CONTAINER_APP_NAME -g $RESOURCEGROUP --secrets github-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientid,identityref:$MANAGEDIDENTITYID github-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientsecret,identityref:$MANAGEDIDENTITYID msft-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientid,identityref:$MANAGEDIDENTITYID msft-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientsecret,identityref:$MANAGEDIDENTITYID emailsender-apikey=keyvaultref:$KEYVAULTURI/secrets/emailsender-apikey,identityref:$MANAGEDIDENTITYID emailsender-secret=keyvaultref:$KEYVAULTURI/secrets/emailsender-secretkey,identityref:$MANAGEDIDENTITYID emailsender-name=keyvaultref:$KEYVAULTURI/secrets/emailsender-sendfromname,identityref:$MANAGEDIDENTITYID emailsender-email=keyvaultref:$KEYVAULTURI/secrets/emailsender-sendfromemail,identityref:$MANAGEDIDENTITYID connectionstring=keyvaultref:$KEYVAULTURI/secrets/connectionstrings-essentialcsharpwebcontextconnection,identityref:$MANAGEDIDENTITYID
az containerapp update --container-name $CONTAINER_APP_NAME --replace-env-vars Authentication:github:clientId=secretref:github-clientid Authentication:github:clientSecret=secretref:github-clientsecret Authentication:microsoft:clientId=secretref:msft-clientid Authentication:microsoft:clientSecret=secretref:msft-clientsecret AuthMessageSender:ApiKey=secretref:emailsender-apikey AuthMessageSender:SecretKey=secretref:emailsender-secret AuthMessageSender:SendFromName=secretref:emailsender-name AuthMessageSender:SendFromEmail=secretref:emailsender-email ConnectionStrings:EssentialCSharpWebContextConnection=secretref:connectionstring
az containerapp secret set -n $CONTAINER_APP_NAME -g $RESOURCEGROUP --secrets github-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientid,identityref:$MANAGEDIDENTITYID \
github-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-github-clientsecret,identityref:$MANAGEDIDENTITYID msft-clientid=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientid,identityref:$MANAGEDIDENTITYID \
msft-clientsecret=keyvaultref:$KEYVAULTURI/secrets/authentication-microsoft-clientsecret,identityref:$MANAGEDIDENTITYID emailsender-apikey=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-apikey,identityref:$MANAGEDIDENTITYID \
emailsender-secret=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-secretkey,identityref:$MANAGEDIDENTITYID emailsender-name=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-sendfromname,identityref:$MANAGEDIDENTITYID \
emailsender-email=keyvaultref:$KEYVAULTURI/secrets/authmessagesender-sendfromemail,identityref:$MANAGEDIDENTITYID connectionstring=keyvaultref:$KEYVAULTURI/secrets/connectionstrings-essentialcsharpwebcontextconnection,identityref:$MANAGEDIDENTITYID
az containerapp update --name $CONTAINER_APP_NAME --resource-group $RESOURCEGROUP --replace-env-vars Authentication:github:clientId=secretref:github-clientid Authentication:github:clientSecret=secretref:github-clientsecret \
Authentication:microsoft:clientId=secretref:msft-clientid Authentication:microsoft:clientSecret=secretref:msft-clientsecret AuthMessageSender:ApiKey=secretref:emailsender-apikey AuthMessageSender:SecretKey=secretref:emailsender-secret \
AuthMessageSender:SendFromName=secretref:emailsender-name AuthMessageSender:SendFromEmail=secretref:emailsender-email ConnectionStrings:EssentialCSharpWebContextConnection=secretref:connectionstring
- name: Logout of Azure CLI
if: 'always()'
uses: azure/CLI@v1
Expand Down

0 comments on commit 6977f29

Please sign in to comment.