Skip to content

Commit b800e53

Browse files
Merge pull request #429 from Azure/shilpirachna1/slotfixmaster
Invoking AzureResourceFilterUtility.getAppDetails with slotname (master)
2 parents 5c1d76e + ce8b292 commit b800e53

File tree

8 files changed

+661
-6465
lines changed

8 files changed

+661
-6465
lines changed

.github/workflows/pr_check_webapp_dotnet_windows.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- master
1313
- 'releases/*'
1414

15+
permissions:
16+
id-token: write
17+
1518
# CONFIGURATION
1619
# For help, go to https://github.com/Azure/Actions
1720
#
@@ -75,9 +78,11 @@ jobs:
7578
}
7679
7780
- name: Azure authentication
78-
uses: azure/login@v1
81+
uses: azure/login@v2
7982
with:
80-
creds: ${{ secrets.AZURE_WEBAPP_SPN }}
83+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
84+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
85+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
8186

8287
- name: 'Deploy to Azure WebApp'
8388
uses: ./webapps-deploy/

.github/workflows/pr_check_windows_container_pubprofile.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- master
1313
- 'releases/*'
1414

15+
permissions:
16+
id-token: write
17+
1518
env:
1619
AZURE_WEBAPP_NAME: wincontainerswebapp # set this to your application's name
1720
CONTAINER_REGISTRY: webdeployprtestscontainerregistry.azurecr.io # set secret with Container Registry URL, example : xyz.azurecr.io
@@ -31,9 +34,11 @@ jobs:
3134
path: 'python_container_App'
3235

3336
- name: Azure authentication
34-
uses: azure/login@v1
37+
uses: azure/login@v2
3538
with:
36-
creds: ${{ secrets.AZURE_WEBAPP_SPN }}
39+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
40+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
41+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3742

3843
- name: Logout from Azure Container Registry
3944
run: |

lib/ActionInputValidator/Validations.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3232
});
3333
};
3434
Object.defineProperty(exports, "__esModule", { value: true });
35-
exports.validatePackageInput = exports.validateContainerInputs = exports.validateSingleContainerInputs = exports.multiContainerNotAllowed = exports.packageNotAllowed = exports.startupCommandNotAllowed = exports.validateAppDetails = exports.containerInputsNotAllowed = exports.appNameIsRequired = void 0;
35+
exports.appNameIsRequired = appNameIsRequired;
36+
exports.containerInputsNotAllowed = containerInputsNotAllowed;
37+
exports.validateAppDetails = validateAppDetails;
38+
exports.startupCommandNotAllowed = startupCommandNotAllowed;
39+
exports.packageNotAllowed = packageNotAllowed;
40+
exports.multiContainerNotAllowed = multiContainerNotAllowed;
41+
exports.validateSingleContainerInputs = validateSingleContainerInputs;
42+
exports.validateContainerInputs = validateContainerInputs;
43+
exports.validatePackageInput = validatePackageInput;
3644
const core = __importStar(require("@actions/core"));
3745
const packageUtility_1 = require("azure-actions-utility/packageUtility");
3846
const PublishProfile_1 = require("../Utilities/PublishProfile");
@@ -44,14 +52,12 @@ function appNameIsRequired(appname) {
4452
throw new Error("app-name is a required input.");
4553
}
4654
}
47-
exports.appNameIsRequired = appNameIsRequired;
4855
// Error if image info is provided
4956
function containerInputsNotAllowed(images, configFile, isPublishProfile = false) {
5057
if (!!images || !!configFile) {
5158
throw new Error(`This is not a container web app. Please remove inputs like images and configuration-file which are only relevant for container deployment.`);
5259
}
5360
}
54-
exports.containerInputsNotAllowed = containerInputsNotAllowed;
5561
// Cross-validate provided app name and slot is same as that in publish profile
5662
function validateAppDetails() {
5763
let actionParams = actionparameters_1.ActionParameters.getActionParams();
@@ -66,36 +72,31 @@ function validateAppDetails() {
6672
}
6773
}
6874
}
69-
exports.validateAppDetails = validateAppDetails;
7075
// Error is startup command is provided
7176
function startupCommandNotAllowed(startupCommand) {
7277
if (!!startupCommand) {
7378
throw new Error("startup-command is not a valid input for Windows web app or with publish-profile auth scheme.");
7479
}
7580
}
76-
exports.startupCommandNotAllowed = startupCommandNotAllowed;
7781
// Error if package input is provided
7882
function packageNotAllowed(apppackage) {
7983
if (!!apppackage && apppackage !== '.') {
8084
throw new Error("package is not a valid input for container web app.");
8185
}
8286
}
83-
exports.packageNotAllowed = packageNotAllowed;
8487
// Error if multi container config file is provided
8588
function multiContainerNotAllowed(configFile) {
8689
if (!!configFile) {
8790
throw new Error("Multi container support is not available for windows containerized web app or with publish profile.");
8891
}
8992
}
90-
exports.multiContainerNotAllowed = multiContainerNotAllowed;
9193
// Error if image name is not provided
9294
function validateSingleContainerInputs() {
9395
const actionParams = actionparameters_1.ActionParameters.getActionParams();
9496
if (!actionParams.images) {
9597
throw new Error("Image name not provided for container. Provide a valid image name");
9698
}
9799
}
98-
exports.validateSingleContainerInputs = validateSingleContainerInputs;
99100
// Validate container inputs
100101
function validateContainerInputs() {
101102
let actionParams = actionparameters_1.ActionParameters.getActionParams();
@@ -123,7 +124,6 @@ function validateContainerInputs() {
123124
throw new Error("Multiple images indicate multi-container deployment type, but Docker-compose file is absent.");
124125
}
125126
}
126-
exports.validateContainerInputs = validateContainerInputs;
127127
// validate package input
128128
function validatePackageInput() {
129129
return __awaiter(this, void 0, void 0, function* () {
@@ -136,4 +136,3 @@ function validatePackageInput() {
136136
}
137137
});
138138
}
139-
exports.validatePackageInput = validatePackageInput;

lib/ActionInputValidator/ValidatorFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ValidatorFactory {
6666
}
6767
static getResourceDetails(params) {
6868
return __awaiter(this, void 0, void 0, function* () {
69-
let appDetails = yield AzureResourceFilterUtility_1.AzureResourceFilterUtility.getAppDetails(params.endpoint, params.appName, params.resourceGroupName);
69+
let appDetails = yield AzureResourceFilterUtility_1.AzureResourceFilterUtility.getAppDetails(params.endpoint, params.appName, params.resourceGroupName, params.slotName);
7070
params.resourceGroupName = appDetails["resourceGroupName"];
7171
params.realKind = appDetails["kind"];
7272
params.kind = actionparameters_1.appKindMap.get(params.realKind);

lib/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3232
});
3333
};
3434
Object.defineProperty(exports, "__esModule", { value: true });
35-
exports.main = void 0;
35+
exports.main = main;
3636
const core = __importStar(require("@actions/core"));
3737
const crypto = __importStar(require("crypto"));
3838
const actionparameters_1 = require("./actionparameters");
@@ -90,5 +90,4 @@ function main() {
9090
}
9191
});
9292
}
93-
exports.main = main;
9493
main();

0 commit comments

Comments
 (0)