PS C:\Users\loginid> az login A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`. [ { "cloudName": "AzureCloud", "homeTenantId": "85cb24e4-0bcf-4767-b44b-39eae544706e", "id": "bd435e85-b401-48c5-90ad-96dbefac1503", "isDefault": true, "managedByTenants": [], "name": "Visual Studio Professional", "state": "Enabled", "tenantId": "85cb24e4-0bcf-4767-b44b-39eae544706e", "user": { "name": "sunny_hll@hotmail.com", "type": "user" } } ]
Az Terraform example
1 2 3 4 5 6 7 8 9 10 11 12 13 14
PS C:\Users\loginid> az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/bd435e85-b401-48c5-90ad-96dbefac1503" Creating 'Contributor' role assignment under scope '/subscriptions/bd435e85-b401-48c5-90ad-96dbefac1503' The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control. For more information, see https://aka.ms/azadsp-cli { "appId": "414b5739-2c30-4cea-adff-d5c8ff1c6470", "displayName": "azure-cli-2022-12-09-06-36-24", "password": "if48Q~Wd6aUHekpKNLrgJWeC3Pr-sstzZHRXfa90", "tenant": "85cb24e4-0bcf-4767-b44b-39eae544706e" }
huangsun@oc-dev:~/helm$ cd gsm/ huangsun@oc-dev:~/helm/gsm$ ls Chart.yaml charts templates values.yaml
# intall release
huangsun@oc-dev:~/helm$ helm install myapp gsm NAME: myapp LAST DEPLOYED: Sun Jun 1 10:07:23 2025 NAMESPACE: optimus STATUS: deployed REVISION: 1 NOTES: 1. Get the application URL by running these commands: export POD_NAME=$(kubectl get pods --namespace optimus -l "app.kubernetes.io/name=gsm,app.kubernetes.io/instance=myapp" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace optimus $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo"Visit http://127.0.0.1:8080 to use your application" kubectl --namespace optimus port-forward $POD_NAME 8080:$CONTAINER_PORT #查看pod状态 huangsun@oc-dev:~/helm$ k get po NAME READY STATUS RESTARTS AGE hello-node-7556f558d-psbrp 1/1 Running 4 537d myapp-gsm-7f8b95f4-g856s 0/1 Error 3 (29s ago) 50s #查看release状态 huangsun@oc-dev:~/helm$ helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION myapp optimus 1 2025-06-01 10:07:23.835586443 +0000 UTC deployed gsm-0.1.0 1.16.0