josh-fell commented on a change in pull request #15159:
URL: https://github.com/apache/airflow/pull/15159#discussion_r609749045



##########
File path: airflow/providers/microsoft/azure/hooks/wasb.py
##########
@@ -57,6 +57,50 @@ class WasbHook(BaseHook):
     conn_type = 'wasb'
     hook_name = 'Azure Blob Storage'
 
+    @staticmethod
+    def get_connection_form_widgets() -> Dict[str, Any]:
+        """Returns connection widgets to add to connection form"""
+        from flask_appbuilder.fieldwidgets import BS3PasswordFieldWidget, 
BS3TextFieldWidget
+        from flask_babel import lazy_gettext
+        from wtforms import PasswordField, StringField
+
+        return {
+            "extra__wasb__connection_string": PasswordField(
+                lazy_gettext('Blob Storage Connection String (optional)'), 
widget=BS3PasswordFieldWidget()
+            ),
+            "extra__wasb__shared_access_key": PasswordField(
+                lazy_gettext('Blob Storage Shared Access Key (optional)'), 
widget=BS3PasswordFieldWidget()
+            ),
+            "extra__wasb__tenant_id": StringField(
+                lazy_gettext('Tenant Id (Active Directory Auth)'), 
widget=BS3TextFieldWidget()
+            ),
+            "extra__wasb__sas_token": PasswordField(
+                lazy_gettext('SAS Token (optional)'), 
widget=BS3PasswordFieldWidget()
+            ),
+        }
+
+    @staticmethod
+    def get_ui_field_behaviour() -> Dict:
+        """Returns custom field behaviour"""
+        return {
+            "hidden_fields": ['schema', 'port', 'host'],
+            "relabeling": {
+                'login': 'Blob Storage Login (optional)',
+                'password': 'Blob Storage Key (optional)',
+                'host': 'Account Name (Active Directory Auth)',
+            },
+            "placeholders": {
+                'extra': 'additional options for use with FileService and 
AzureFileVolume',
+                'login': 'account name',
+                'password': 'secret',
+                'host': 'account url',
+                'extra__wasb__connection_string': 'connection string auth',
+                'extra__wasb__tenant_id': 'tenant',

Review comment:
       Making this consistent with other instances of Tenant ID




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to