Skip to content

Commit d2428a8

Browse files
anjannathadrianriobo
authored andcommitted
azure: implement DefaultHostingPlace method
adds implementation for the missing method to satisfy the provider interface Signed-off-by: Anjan Nath <[email protected]>
1 parent de73894 commit d2428a8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/provider/azure/azure.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package azure
22

33
import (
4+
"fmt"
45
"os"
56
"slices"
67
"strings"
@@ -30,7 +31,15 @@ func (a *Azure) Init(backedURL string) error {
3031
}
3132

3233
func (a *Azure) DefaultHostingPlace() (*string, error) {
33-
return nil, nil
34+
hp := os.Getenv("ARM_LOCATION_NAME")
35+
if len(hp) > 0 {
36+
return &hp, nil
37+
}
38+
hp = os.Getenv("AZURE_DEFAULTS_LOCATION")
39+
if len(hp) > 0 {
40+
return &hp, nil
41+
}
42+
return nil, fmt.Errorf("missing default value for Azure Location")
3443
}
3544

3645
// Envs required for auth with go sdk

0 commit comments

Comments
 (0)