@@ -104,6 +104,7 @@ var _ = BeforeSuite(func() {
104
104
// ci cloud
105
105
ciJsonData , err := utils .GetJsonData (ci_cred_file )
106
106
Expect (err ).NotTo (HaveOccurred ())
107
+
107
108
if _ , ok := ciJsonData ["resourceGroup" ]; ! ok {
108
109
resourceGroup , err := GetAzureResource (azure_resource_file )
109
110
Expect (err ).NotTo (HaveOccurred ())
@@ -116,6 +117,23 @@ var _ = BeforeSuite(func() {
116
117
err = utils .WriteFile (dpaCR .Credentials , ciCreds )
117
118
Expect (err ).NotTo (HaveOccurred ())
118
119
}
120
+ } else {
121
+ if dpaCR .Provider == "azure" {
122
+ cloudCredData , err := utils .GetJsonData (dpaCR .Credentials ) // azure credentials need to be in json - can be changed
123
+ Expect (err ).NotTo (HaveOccurred ())
124
+ dpaCR .DpaAzureConfig = DpaAzureConfig {
125
+ BslSubscriptionId : fmt .Sprintf ("%v" , cloudCredData ["subscriptionId" ]),
126
+ BslResourceGroup : fmt .Sprintf ("%v" , cloudCredData ["resourceGroup" ]),
127
+ BslStorageAccount : fmt .Sprintf ("%v" , cloudCredData ["storageAccount" ]),
128
+ BslStorageAccountKeyEnvVar : "AZURE_STORAGE_ACCOUNT_ACCESS_KEY" ,
129
+ VslSubscriptionId : fmt .Sprintf ("%v" , cloudCredData ["subscriptionId" ]),
130
+ VslResourceGroup : fmt .Sprintf ("%v" , cloudCredData ["resourceGroup" ]),
131
+ }
132
+ ciCreds := GetAzureCreds (cloudCredData )
133
+ dpaCR .Credentials = "/tmp/azure-credentials"
134
+ err = utils .WriteFile (dpaCR .Credentials , ciCreds )
135
+ Expect (err ).NotTo (HaveOccurred ())
136
+ }
119
137
}
120
138
credData , err := utils .ReadFile (dpaCR .Credentials )
121
139
Expect (err ).NotTo (HaveOccurred ())
0 commit comments