F5Networks / f5-cloud-iapps

iApps specific to BIG-IPs in cloud environments
12 stars 10 forks source link

Enhancement: f5.cloud_logger: Support for Azure US Gov #2

Closed chen23 closed 6 years ago

chen23 commented 6 years ago

Currently the Azure OMS integration in f5.cloud_logger will only support the commercial Azure environment.

Example of support for Azure US Gov (change ".com" to ".us")

--- a/f5-cloud-logger/f5.cloud_logger.v1.0.0.tmpl
+++ b/f5-cloud-logger/f5.cloud_logger.v1.0.0.tmpl
@@ -265,7 +265,7 @@ when HTTP_RESPONSE_DATA {
        ## Account for uniqueness in the iRule(s) based on which analytics solution it is using
        # Keys: $analytics_solution
        array set host_arr {
-               azure_oms                       { ${workspace}.ods.opinsights.azure.com }
+               azure_oms                       { ${workspace}.ods.opinsights.azure.us }
                aws_cw                          { logs.${aws_region}.amazonaws.com }
                *                                       { not_required }
        }
@@ -406,7 +406,7 @@ when HTTP_RESPONSE_DATA {
        # create analytics solution pool
        # Keys: $analytics_solution
        array set pool_arr {
-               azure_oms { [iapp::conf create ltm pool ${app}_logging_offbox \{ members replace-all-with \{ [format_poolmembers ${workspace}.ods.opinsights.azure.com:443] \} monitor tcp \}] }
+               azure_oms { [iapp::conf create ltm pool ${app}_logging_offbox \{ members replace-all-with \{ [format_poolmembers ${workspace}.ods.opinsights.azure.us:443] \} monitor tcp \}] }
                aws_cw { [iapp::conf create ltm pool ${app}_logging_offbox \{ members replace-all-with \{ [format_poolmembers logs.${aws_region}.amazonaws.com:443] \} monitor tcp \}] }
                * {}
        }
jsevedge commented 6 years ago

@chen23 Thanks for opening this issue, once .com was changed to .us as described above did it then log as expected?

chen23 commented 6 years ago

Yup, everything logged as expected. I only tested AFM/ASM logs.

jsevedge commented 6 years ago

@chen23 Ok, added this to the list of enhancements for a future release.

jsevedge commented 6 years ago

@chen23 I added initial support for azure gov cloud and pushed it to the develop branch of this repo if you would like to test out? (I do not have a gov cloud environment handy)

chen23 commented 6 years ago

@jsevedge thanks for the speedy turnaround. It works! FYI the "Yes/No" works today, but maybe just make it "Azure" and "AzureUSGovernment" as the two options in case future environments get added that have custom endpoints (i.e. Germany). https://github.com/Azure/ms-rest-azure-env/blob/master/lib/azureEnvironment.ts#L211

jsevedge commented 6 years ago

@chen23 Ah, i was debating going that route right now vs later but agree and will update.

jsevedge commented 6 years ago

Support for Azure gov cloud has been added in just released version v1.3.0.

Closing out.